package com.siashan.sensitive;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.siashan.sensitive.serializer.AbstractSensitiveStrategy;
import com.siashan.sensitive.serializer.DefaultStrategy;
import com.siashan.sensitive.serializer.SensitiveJsonSerializer;

import java.lang.annotation.*;


/**
 * 敏感注解
 *
 * @author siashan
 * @date 2023/4/3
 * @since 1.2.1
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveJsonSerializer.class)
public @interface Sensitive {
    /**
     * 脱敏策略
     * @return
     */
    Class<? extends AbstractSensitiveStrategy> strategy() default DefaultStrategy.class;

    /**
     * 是否进行脱敏处理
     * @return
     */
    Class<? extends AbstractDesensitization> desensitization() default DefaultDesensitization.class;
}
